//
// Created by vcq on 21/2/9.
//
#pragma once
#include "dbng.hpp"
struct grade {
    int id;
    string name;
};
REFLECTION(grade, id, name)
json mgetAllGrades(){
    string sql="select * from grade";
    Dao dao;
    auto v = dao.query<grade>(sql);
    nlohmann::json article_list;
    for (auto& o : v) {
        nlohmann::json item;
        item["id"]=o.id;
        item["name"]=o.name;
        article_list.push_back(item);
    }
    return article_list;
}
